package myservlet.control;
import java.io.IOException;
import java.util.LinkedList;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.swing.JOptionPane;

import mybean.data.login;

public class HandleBorrowBike extends HttpServlet{
	public void init(ServletConfig config) throws ServletException {
		// TODO Auto-generated method stub
			super.init(config);
			try {//加载驱动
				Class.forName("com.mysql.jdbc.Driver");
				//System.out.println("加载驱动成功");
				
			}
			catch(Exception e) {}
		}
	public  void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
		String bikeMess = req.getParameter("");//获取用户提交的地区名
		login loginBean =null; 
		HttpSession session= req.getSession(true);
		try {
			loginBean = (login)session.getAttribute("loginBean");
			LinkedList<String>car = loginBean.getcar();
			//car.remove(delete);// 从订单中删除产品，即还车
			JOptionPane.showMessageDialog(null, "还车成功，感谢使用，欢迎再次使用！");
		}
		catch (Exception exp){}
		req.getRequestDispatcher("return.jsp").forward(req, resp);//转到还车页面
	}	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
}
